﻿using Quartz;
using Quartz.Impl;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutoUpdater
{
    class JobScheduler
    {

        public async static void Start()
        {

            IScheduler scheduler = await StdSchedulerFactory.GetDefaultScheduler();
            await scheduler.Start();

            var jobDetail = JobBuilder.Create<GitJob>().Build();


            var trigger = TriggerBuilder.Create()
                            .WithCronSchedule(Config.cronSchedule)
                            .Build();

            await scheduler.ScheduleJob(jobDetail, trigger);

        }
    }
}
